<template>
  <div class="interactive-btn" :class="getStyle()" @click.stop="click">
    {{ info.action }}
  </div>
</template>

<script>
export default {
  name: 'Icon',
  data() {
    return {};
  },
  props: {
    info: {
      type: Object,
      default: () => ({}),
    },
  },
  methods: {
    click() {
      this.$emit('change', '');
    },
    getStyle() {
      let style;
      switch (this.info.action) {
      case '待开播':
      case '预约':
        style = 'normal';
        break;
      case '看直播':
        style = 'red';
        break;
      case '已预约':
        style = 'unable';
        break;
      case '看回放':
        style = 'yellow';
        break;
      default:
        style = 'none';
        break;
      }
      return style;
    },
  },
};
</script>

<style lang="less" scoped>
.interactive-btn {
  height: 0.48rem;
  width: 1.12rem;
  text-align: center;
  background: #3366ff;
  border-radius: 0.26rem;
  line-height: 0.48rem;
  font-size: 0.24rem;
  color: #ffffff;
}
.none {
  display: none;
}
.normal {
  background: #3366ff;
}
.red {
  background: #ff2436;
}
.yellow {
  background: #ff9500;
}
.unable {
  background: #f6f6f6;
  color: rgba(0, 0, 0, 0.4);
}
</style>
